using System;
using Sce.Pss.HighLevel.GameEngine2D;
using Sce.Pss.HighLevel.GameEngine2D.Base;
using Sce.Pss.HighLevel.Physics2D;
using Sce.Pss.Core.Input;

using Sce.Pss.Core;


namespace RedSkies
{
	public class FireSprite:SpriteUV
	{
		protected int Count =0;
		
		public int SpeedX {get; protected set; }
		public int SpeedY {get; protected set; }
		
		protected int MaxCount=100;
		
		public FireSprite()
		{
			this.SpeedX = 1;
			this.SpeedY = 0;
		}			

		public FireSprite(int speedx, int speedy, int maxcount)
		{
			this.SpeedX = speedx;
			this.SpeedY = speedy;
			this.MaxCount = maxcount;
		}			
		
		public void ResetFire()
		{
			Count=0;
		}
		
		public void NextMove()
		{
			Count++;
		}
		
		public bool AtEndOfAnimation()
		{
			return Count>=MaxCount;
		}
		
		public Rectangle Update(GamePadData gamepad)
		{
			Position = new Vector2(Position.X+SpeedX, Position.Y+SpeedY);	
			NextMove();
			
			return new Rectangle(Position.X, Position.Y, this.Quad.S.X, this.Quad.S.Y);			                     
		}		
	}
}

